package com.siteseat.common.json;

import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.Provider;

import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
import org.codehaus.jackson.map.ObjectMapper;

@Provider
@Consumes( { "application/json", "text/json" } )
@Produces( { "application/json", "text/json" } )
public class MyJacksonJsonProvider extends JacksonJsonProvider {

  /**
   * {@inheritDoc}
   */
  @Override
  public ObjectMapper locateMapper( Class<?> arg0, MediaType arg1 ) {
    ObjectMapper result = JacksonMapper.MAPPER;
    // result.configure(org.codehaus.jackson.map.SerializationConfig.Feature.INDENT_OUTPUT,
    // true);
    return result;
  }

}
